const wordSum = word => {
  let sum = 0;
  const aVal = 'a'.charCodeAt(0);
  for (const char of word) {
    let val = char.charCodeAt(0) - aVal + 1;
    if (val < 0) val = (val + 32) * 2;
    sum += val;
  }
  return sum;
}


function battle(ourTeam, opponent) {
  let weWinNum = 0;
  let weLoseNum = 0;
  const ourTeamWords = ourTeam.split(' ');
  const opponentWords = opponent.split(' ');
  for (let i=0; i < ourTeamWords.length; i++) {
    if (wordSum(ourTeamWords[i]) > wordSum(opponentWords[i])) weWinNum++;
    else if (wordSum(ourTeamWords[i]) < wordSum(opponentWords[i])) weLoseNum++;
  }
  if (weWinNum > weLoseNum) return 'We win';
  else if (weWinNum === weLoseNum) return 'Draw';
  else return 'We lose';
}

console.log(battle("hello world", "hello word"));